package edu.usc.csci578.algorithm;

import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.List;

import edu.usc.csci578.model.Cluster;
import edu.usc.csci578.model.SClass;

public class EnvyFactoryAlgorithm extends AbstracAlgorithm {

	@Override
	public SolutionSet execute(OutputStream stream) throws Exception {
		PrintWriter pw = new PrintWriter(stream);
		List<Cluster> cs = mm.getAllClusters();
		for (Cluster c : cs) {
			// System.out.println(c.printOut());
			for (SClass sc : c.getClasses()) {
				if (sc.getName().endsWith("Factory")
						|| c.getClasses().size() == 1) {
					System.out.println(sc.getUniqueName());
					System.out.println(c);
					System.out.println(c.printIn());
					System.out.println(c.printOut());
				}
			}
		}

		return null;
	}

	@Override
	public String getDescription() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return null;
	}

}
